﻿// CDialogHide.cpp: 实现文件
//
#include "stdafx.h"
//#include "pch.h"
#include "CDialogHide.h"
#include "afxdialogex.h"


// CDialogHide 对话框

IMPLEMENT_DYNAMIC(CDialogHide, CDialog)

CDialogHide::CDialogHide(CWnd* pParent /*=nullptr*/)
	: CDialog(CDialogHide::IDD, pParent)
	//: CDialog(IDD_DIALOG_HIDE, pParent)
{

}

CDialogHide::~CDialogHide()
{
}

void CDialogHide::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
}


BEGIN_MESSAGE_MAP(CDialogHide, CDialog)
	ON_WM_WINDOWPOSCHANGING()
	ON_WM_CLOSE()
END_MESSAGE_MAP()


// CDialogHide 消息处理程序


void CDialogHide::OnWindowPosChanging(WINDOWPOS* lpwndpos)
{


	CDialog::OnWindowPosChanging(lpwndpos);

	lpwndpos->flags &= ~SWP_SHOWWINDOW;
}

void CDialogHide::OnClose()
{
	//APP对话框先顶层，否则QHEX一取消APP界面也缩到后面
	::SetWindowPos(m_hwd808iApp, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
	//APP对话框再去除顶层，这样QHEX出来了，但是也是可以切换到后面的
	::SetWindowPos(m_hwd808iApp, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);

	CDialog::OnClose();
}
